<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>研学旅行</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" th:href="@{/css/font.css}">
	<link rel="stylesheet" th:href="@{/css/xadmin.css}">
    <link rel="stylesheet" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.min.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.jquery.min.js"></script>
    <script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>
</head>
<body>
    <!-- 中部开始 -->
    <div class="wrapper">
        <!-- 右侧主体开始 -->
        <div class="page-content">
          <div class="content">
            <!-- 右侧内容框架，更改从这里开始 -->
            <form class="layui-form" th:action="@{/user/employeeedit}" method="post">
                <div class="layui-form-item">
                    <label for="L_email" class="layui-form-label">
                        <span class="x-red">*</span>邮箱
                    </label>
                    <div class="layui-input-inline">
                         <input type="hidden" id="L_email" name="id" required="" 
                        autocomplete="off" class="layui-input" th:value="${employee.id}">
                        
                        <input type="text" id="L_email" name="email" required="" lay-verify="email"
                        autocomplete="off" readonly="readonly" class="layui-input" th:value="${employee.email}">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        <span class="x-red">*</span>将会成为您唯一的登入名
                    </div>
                </div>
            <form class="layui-form" th:action="@{/user/userupdate}" method="post">
                <div class="layui-form-item">
                    <label for="L_username" class="layui-form-label">
                        <span class="x-red">*</span>员工姓名
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="L_username" readonly="readonly" name="employeename" required="" lay-verify="nikename"
                        autocomplete="off" class="layui-input" th:value="${employee.employeename}">
                    </div>
                </div>
                
                 <div class="layui-form-item">
                    <label for="L_username" class="layui-form-label">
                        <span class="x-red">*</span>地址
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="L_address" readonly="readonly" name="address" required="" lay-verify="nikename"
                        autocomplete="off" class="layui-input" th:value="${employee.address}">
                    </div>
                </div>
                
                 <div class="layui-form-item">
                    <label for="L_username" class="layui-form-label">
                        <span class="x-red">*</span>手机号码
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="L_phone"  readonly="readonly" name="phone" required="" lay-verify="nikename"
                        autocomplete="off" class="layui-input" th:value="${employee.phone}">
                    </div>
                </div>
                
                
             	<div class="layui-form-item">
                    <label for="L_username" class="layui-form-label">
                        <span class="x-red">*</span>选择角色
                    </label>
                    <div class="layui-inline">
                    <select name="rid" lay-filter="test"> 
            			<option th:each="l,state : ${list1}" th:text="${l.name}" th:value="${l.rid}"></option>
            		</select>
                    </div>
                </div>
                
                
                <div class="layui-form-item">
                    <label for="L_repass" class="layui-form-label">
                    </label>
                    <button  class="layui-btn"  lay-submit="" onclick="submit_()">
                        修改
                    </button>
                </div>
            </form>
          </div>
        </div>
    </div>

</body>
<script th:src="@{/layui-v2.4.5/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/js/vue.js}"></script>
<script type="text/javascript" th:inline="javascript">
      
      
function submit_(){
	var index = parent.layer.getFrameIndex(window.name);
	parent.layer.close(index);
}

      
  	var urlpath = [[@{/employee/queryzw}]];
     
$(function(){
	
	 layui.use('form', function(){
		  var form = layui.form;
		 form.on('select(test)', function(data){
		  //得到select原始DOM对象
		  //得到被选中的值
		 	$.ajax({
			 url:urlpath,
			 data:{
				 id:data.value
			 },
			 datatype:"json",
			 success:function(res){
				 if(res!=null){
					 $("#zw").find("option").remove();
					 $("#zw").append("<option>" + res.spare1 + "</option>");
					 $("#zw").append("<option>" + res.spare2 + "</option>");
					 form.render('select');
				 }
             
				
			 }
				})
				});  
			});
})
</script>

</html>